import { connect } from 'react-redux';
import SelectRelation from 'shared/components/SelectRelation';
import * as actions from './actions';
import * as actionTypes from './consts';

const { datas } = actionTypes.key;
const mapStateToProps = state => ({
  /** 全局loading标记 */
  loading: state.loading,
  /** 全局error标记 */
  error: state.error,
  /** redux 数据 赋值给 props */
  datas: state.{{moduleName}}.get(datas),
  title: '选择{{moduleText}}',
});

const mapDispatchToProps = {
  /** 获取接口数据 */
  getDatas: actions.getDatas,
};

export default connect(mapStateToProps, mapDispatchToProps)(SelectRelation);
